<template>
	<view class="setContainer">
		<view class="infoItemBox" @click="showPopup">
			<text>{{receivedType}}</text>
			<image class="to" src="../../../static/yhk1.png" mode=""></image>
		</view>
		<view class="infoItemBox" v-if="receivedID===0">
			<input type="text" placeholder="卡号">
		</view>
		<view class="infoItemBox" v-if="receivedID===0">
			<input type="text" placeholder="银行">
		</view>
		<view class="infoItemBox">
			<input type="text" placeholder="姓名">
		</view>
		<view class="infoItemBox" v-if="receivedID===1">
			<input type="text" placeholder="账号">
		</view>
		
		<navigator url="/pages/user/setting/index">
			<button class="btn" @click="goOut">绑定</button>
		</navigator>
		<u-popup mode="bottom" custom-style="background: none" :show="show" @close="onClose">
			<view class="showCount">
				<image class="close" @click="onClose" src="../../../static/yhk2.png" mode=""></image>
				<view class="title">选择到账银行卡</view>
				<view class="cardList" v-for="(item,index) in cardList" :key="index" @click="activeCard(item,index)">
					<text :class="['cardName',index==active ? 'active' : '']">{{item.value}}</text>
					<view class="FX1"></view>
					<image v-if="index==active" src="../../../static/yhk3.png" mode=""></image>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				receivedType:'到账类型',
				receivedID:0,
				show: false,
				active:null,
				cardList: [{
						id: 0,
						value: '银行卡'
					},
					{
						id: 1,
						value: '支付宝'
					}
				]
			}
		},

		onShow() {

		},
		methods: {
			showPopup() {
				this.show = true
			},
			onClose() {
				this.show = false
			},
			activeCard(e, index) {
				this.active = index
				this.receivedType = e.value
				this.receivedID = e.id
				this.onClose()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.infoItemBox {
		border-bottom: 1rpx solid #CCCCCC;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background-color: #fff;
		padding: 70rpx 27rpx 36rpx 27rpx;
		// font-size: 24rpx;
		color: #333333;
		margin: 0 20rpx 0 20rpx;
		input {
			width: 80%;
		}

		.to {
			width: 30rpx;
			height: 30rpx;
			margin-top: 6rpx;
		}
	}


	.btn {
		width: 500rpx;
		height: 70rpx;
		line-height: 70rpx;
		background: #2168EA;
		border-radius: 35rpx;
		font-weight: 400;
		font-size: 32rpx;
		color: #FFFFFF;
		margin-top: 130rpx;
	}

	.showCount{
		background-color: #FFFFFF;
		padding: 40rpx 30rpx 174rpx 30rpx;
		.close{
			width: 30rpx;
			height: 30rpx;
			margin-left: 21rpx;
		}
		.title{
			font-weight: 400;
			font-size: 26rpx;
			color: #333333;
			text-align: center;	
			padding-top: 12rpx;
			padding-bottom: 73rpx;
			width: 690rpx;
			height: 2rpx;
			border-bottom: 2rpx solid #D3D3D3;
		}
		.cardList{
			display: flex;
			align-items: center;
			padding: 48rpx 35rpx;
			border-bottom: 2rpx solid #D3D3D3;
			.cardName{
				font-weight: 300;
				font-size: 30rpx;
				color: #333333;
			}
			image{
				width: 30rpx;
				height: 30rpx;
				margin-top: 6rpx;
			}
			.active{
					font-weight: bold;
					font-size: 30rpx;
					color: #333333;
			}
		}
	}
	

	uni-button:after {
		border: none;
	}
</style>